<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:100:"/www/wwwroot/jiedai.bianshenn.top/public/../application/admin/view/authentication/member_insert.html";i:1552963830;}*/ ?>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" href="../css/pintuer.css">
    <link rel="stylesheet" href="../css/admin.css">
    <script src="../js/jquery.js"></script>
    <script src="../js/pintuer.js"></script>
    <script src="../layer/layer.js"></script>
</head>
<body>
    <div class="panel admin-panel">
        <div class="panel-head"><strong> 添加信息</strong></div>
        <div class="body-content">
            <div class="form-x">
                <div class="form-group">
                    <div class="label">
                        <label for="sitename">账户：</label>
                    </div>
                    <div class="field">
                        <input type="text" class="input w50"  name="name" id="name" size="50" data-validate="required:请输入信息,repeat#password:"/>
                    </div>
                </div>
                <div class="form-group">
                    <div class="label">
                        <label for="sitename">密码：</label>
                    </div>
                    <div class="field">
                        <input type="password" class="input w50"  name="password" id="password"  size="50" data-validate="required:请输入信息,repeat#password:"/>
                    </div>
                </div>
                <div class="form-group">
                    <div class="label">
                        <label for="sitename">手机号：</label>
                    </div>
                    <div class="field">
                        <input type="text" class="input w50"  name="phone" id="phone"  size="50" data-validate="required:请输入信息,repeat#password:"/>
                    </div>
                </div>


            </div>
            <center><button class="button bg-main icon-check-square-o" onclick="express_insert()"> 提交</button>   </center>
        </div>
    </div>
    </div>
</body>
<script>
    function express_insert() {
        var name = $(" input[ name='name' ] ").val();
        var password = $(" input[ name='password' ] ").val();
        var phone = $(" input[ name='phone' ] ").val();
        if(name == ""){
            alert("手机号码有误，请重填");
            return false;
        }
        if(password == ""){
            alert("手机号码有误，请重填");
            return false;
        }
        if(!(/^1(3|4|5|7|8)\d{9}$/.test(phone))){
            alert("手机号码有误，请重填");
            return false;
        }
        $.ajax({
            url: "memberadd",
            type: "POST",
            data: {"name":name,"password":password,"phone":phone},
            dataType: "json",
            //success 会在成功接收到返回数据后触发
            success:function (re) {
                if(re.code == 1){
                    layer.alert('操作成功',function () {
                        location.href="<?php echo url('authentication/loan_examine'); ?>";
                    });
                }
                if(re.code == 0){
                    layer.alert('提交不能为空');
                }
                if(re.code == 2){
                    layer.alert('操作失败');
                }
                if(re.code == 3){
                    layer.alert('重复添加');
                }
            }
        });
    }
</script>
</html>